package com.spring.c_inject.static_factory;

import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author restyhap
 * @date 2019年03月07日 14:57
 */
public class UserTest {
    /**
     * 测试通过spring静态工厂获取实例
     */
    @Test
    public void mainTest(){
        String xmlPath = "beans_c_static.xml";
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(xmlPath);
        IUser iUser = context.getBean("user",IUserImpl.class);
        iUser.add();
    }
}
